package com.epfly.promo.activity.feign;

import com.ifood.model.common.base.IFoodResponseEntity;
import com.ifood.model.common.constants.IFoodCommosConstants;
import com.ifood.model.goods.param.request.food.FoodByIdQuery;
import com.ifood.model.goods.param.response.food.FoodInfo;
import com.ifood.model.goods.param.urls.GoodsFoodUrlConstants;
import com.ifood.model.goods.validation.FoodValidationGroups;
import com.ifood.model.merchants.param.MerchantOptions;
import com.ifood.model.merchants.param.request.MerchantQuery;
import com.ifood.model.merchants.param.response.IdentityEmpResp;
import com.ifood.model.merchants.param.response.MerchantInfo;
import com.ifood.model.merchants.param.response.StoreInfo;
import com.ifood.model.merchants.url.MerchantsUrlConstants;
import com.ifood.model.transaction.url.OrderUrlConstants;
import com.ifood.model.transaction.url.TransactionUrlConstants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = IFoodCommosConstants.data_restaurant)
 public interface DataRestaurantFeign {

    /**
     * 商户相关接口
     */
    @RequestMapping(value = MerchantsUrlConstants.MER_MERCHANT_QUERYBYMERCHANTID, method = RequestMethod.POST)
     IFoodResponseEntity<MerchantInfo> queryByMerchantId(@RequestBody MerchantOptions merchantOptions);

    @PostMapping(value = MerchantsUrlConstants.MER_MERCHANT_QUERYBYMERCHANTIDS)
     IFoodResponseEntity<List<MerchantInfo>> queryByMerchantIds(@RequestBody MerchantQuery merchantQuery);


    /**
     * 查询某商户下所有档口
     */
    @GetMapping(value = MerchantsUrlConstants.MER_STORE_queryStoreByMerchantId)
     IFoodResponseEntity<List<StoreInfo>> queryStoreByMerchantId(@RequestParam String merchantId);

    /**
     * 根据商户ID+档口ID+订单时间，计算餐别
     */
    @GetMapping(value = OrderUrlConstants.GET_MEAL_TYPE)
     IFoodResponseEntity<Integer> getMealType(@RequestParam String merchantId, @RequestParam String storeId, @RequestParam Long orderTime);

    /**
     * 判断指定日期是否是节假日
     */
    @RequestMapping(value = TransactionUrlConstants.TS_IS_HOLIDAY, method = RequestMethod.POST)
     IFoodResponseEntity<Boolean> isHoliday(@RequestParam String date);

    /**
     * 员工身份信息
     */
    @PostMapping(value = MerchantsUrlConstants.EMPLOYEE_GET_IDENTITY)
     IFoodResponseEntity<IdentityEmpResp> getIdentity(@RequestParam String employeeId);

    /**
     * 根据菜品ID查找菜品分类ID
     */
    @PostMapping(GoodsFoodUrlConstants.FOOD_GET_FOOD_CATEGORY_ID_LIST_BY_FOOD_ID_LIST)
     IFoodResponseEntity<List<String>> getFoodCategoryIdListByFoodIdList(List<String> goodIdList);

    @PostMapping(GoodsFoodUrlConstants.FOOD_QUERY_BASIC_BY_ID_LIST)
     IFoodResponseEntity<List<FoodInfo>> queryBasicByIdList(@RequestBody @Validated(FoodValidationGroups.QueryByIdList.class) FoodByIdQuery foodByIdQuery);

}
